package com.fjb.controller.feedback;


import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fjb.common.entity.HttpCode;
import com.fjb.common.entity.JsonResult;
import com.fjb.common.enums.product.CategoryStatus;
import com.fjb.pojo.feedback.SysFeedbackType;
import com.fjb.pojo.product.query.ProductCategoryQuery;
import com.fjb.pojo.product.vo.ProductCategoryVo;
import com.fjb.service.feedback.SysFeedbackTypeService;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

/**
 * <p>
 * 反馈类型表 前端控制器
 * </p>
 *
 * @author hemiao
 * @since 2020-02-13
 */
@Controller
@RequestMapping("/feedbackType")
public class SysFeedbackTypeController {
	
	@Autowired
	private SysFeedbackTypeService sysFeedbackTypeService;
	
	/**
	 * @Description:查询反馈类型列表
	 * @param request
	 * @return
	 * JsonResult<List<SysFeedbackType>>
	 * @exception:
	 * @author: hemiao
	 * @time:2020年2月13日 下午8:33:50
	 */
	@RequestMapping(value="/selectList")
	@ResponseBody
	public JsonResult<List<SysFeedbackType>> selectList(HttpServletRequest request){
		QueryWrapper<SysFeedbackType> queryWrapper = new QueryWrapper<SysFeedbackType>();
		queryWrapper.eq("type_status", 1);
		List<SysFeedbackType> infoList = new ArrayList<SysFeedbackType>();
		SysFeedbackType type = new SysFeedbackType();
		type.setId(0);
		type.setTypeName("请选择反馈类型");
		infoList.add(type);
		List<SysFeedbackType> list = sysFeedbackTypeService.list(queryWrapper);
		if(list.size()>0) {	
			infoList.addAll(list);
		}
		return new JsonResult<List<SysFeedbackType>>(infoList, HttpCode.SUCCESS);
	}
}
